<?php
class driver_mssql {
    private $link = null;

    function __construct($host, $username, $pw) {
        $this->link = mssql_connect($host, $username, $pw);
    }

    function getLink() { return $this->link; }

    function selectDatabase($db) {
        mssql_select_db($db, $this->link);
    }

    function escape($str) {
        if(is_numeric($data))
            return $data;
        $unpacked = unpack('H*hex', $data);
        return '0x' . $unpacked['hex'];
    }

    function query($queryString) {
        return mssql_query($queryString, $this->link);
    }
    
    function getInsertedId() {
//        return mssql_insert_id($this->link);
    }
}

?>
